
#include "CMultiplicator.h"
#include "CSubject.h"
#include <iostream>
#include <string>

using namespace std;


CMultiplicator::CMultiplicator(CSubject* theSubject, string theObserverName)
{
    itsSubject = theSubject;
    myObserverName = theObserverName;
    myMultiplier = 1;
}


CMultiplicator::~CMultiplicator()
{

}


void CMultiplicator::update()
{        
    int data = itsSubject->getData();

    cout << myObserverName << " update and calculate \t=> " << data << " * " << myMultiplier << " = "  <<  data * myMultiplier << endl;
}


void CMultiplicator::setMultiplier(int theValue)
{
    cout << myObserverName << " set multiplier value to: "  << theValue << endl;
	myMultiplier = theValue;
}
